﻿using System.Diagnostics.CodeAnalysis;

namespace ImageManager.Model
{
    public class ModelEqualityComparer<T> : IEqualityComparer<T> where T : BaseModel, new()
    {
        public bool Equals(T x, T y)
        {
            return x.Pk.Equals(y.Pk);
        }

        public int GetHashCode([DisallowNull] T obj)
        {
            return obj.Pk.GetHashCode();
        }
    }
}
